<?php
$this->menu = array(
	array('label'=>'文章管理列表', 'url'=>array('admin'), 'visible'=>Yii::app()->user->v('manage@ArticleAdmin')),
);
$cs = Yii::app()->clientScript;
$cs->registerScriptFile(BASE_URL . '/js/jquery_plus/jquery.form.js', CClientScript::POS_END);
?>
<h2><a href="/manage/article/admin">文章管理列表</a> > 文章编辑</h2>
<?php 
$this->beginWidget('CActiveForm', array(
	'id'			=> 'article_cate_form',
	'htmlOptions' 	=> array('class'=>'setting_form'),
));
?>
	<div class="setting_nav"></div>
	<dl class="setting_content">
		<dt>基本信息</dt>
		<dd>
			<strong>文章名称：</strong>
			<?php echo YHtml::activeTextField($model, 'title', array('model'=>'Article', 'rule'=>'^.{1,50}$', 'next_focus'=>''))?>
		</dd>
		<dd>
			<strong>文章编号：</strong>
			<?php echo YHtml::activeTextField($model, 'code', array('model'=>'Article', 'rule'=>'^$|^[_|a-z|A-Z|0-9]{1,20}$', 'next_focus'=>''))?>
			<p>数字、字母与_组成，不可重复，用于组件引用</p>
		</dd>
		<dd>
			<strong>文章概要：</strong>
			<?php echo YHtml::activeTextArea($model, 'summary', array('model'=>'Article'))?>
		</dd>
		<dd>
			<strong>分类：</strong>
			<?php echo YHtml::activeDropDownList($model, 'cate', ArticleCateModel::getOpts(), array('model'=>'Article', 'next_focus'=>''))?>
			<p><a href="/Manage/ArticleCate/Edit">添加文章分类</a></p>
		</dd>
		<dd>
			<strong>标识：</strong>
			<?php 
			$this->widget('manage.widget.EnumsSelectorWidget', array(
				'code' => 'article_flags',
				'name' => 'Article[article_flags][]',
				'values' => isset($model['article_flags'])?$model['article_flags']:null
			));
			?>
		</dd>
		<dd>
			<strong>排序：</strong>
			<?php echo YHtml::activeTextField($model, 'rank', array('model'=>'Article', 'next_focus'=>'', 'rule'=>'^\d+$'))?>
			<p>越小排序越靠前</p>
		</dd>
		<dt>文章描述</dt>
		<dd>
			<?php 
			$this->widget('application.widget.EditorWidget',array(
				'name'	=> 'Article[desc]',
				'id'	=> 'editor_desc',
				'value' => (isset($model['desc'])?$model['desc']:''),
			));
			?>
		</dd>
		<dt>文章图片</dt>
		<dd>
			<?php 
			$this->widget('manage.widget.UploaderWidget',array(
				'main_picture' 	=> isset($model['main_picture'])?$model['main_picture']:null, 
				'pictures' 		=> isset($model['pictures'])?$model['pictures']:null,
			));
			?>
		</dd>
		<?php echo $this->renderPartial('../common/seo', array('model'=>$model));?>
		<dt>高级设置</dt>
		<dd>
			<strong>页面模板：</strong>
			<?php echo YHtml::activeTextField($model, 'tpl_view', array('model'=>'Article', 'next_focus'=>''))?>
			<p>指定明细页面使用模板</p>
		</dd>
		<dd>
			<strong>页面名称：</strong>
			<?php echo YHtml::activeTextField($model, 'name_view', array('model'=>'Article', 'next_focus'=>''))?>
			<p>明细URL名称（不包含路径）</p>
		</dd>
	</dl>
	<div class="buttons right">
		<?php echo YHtml::activeHiddenField($model, '_id', array('model'=>'Article'))?>
		<input type="button" class="button save_btn" value="保存"/>
	</div>
<?php $this->endWidget(); ?>
